unit ufMainDirectory;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Label8: TLabel;
    Label7: TLabel;
    Label6: TLabel;
    Shape11: TShape;
    Shape10: TShape;
    Shape9: TShape;
    Panel1: TPanel;
    Shape1: TShape;
    Label2: TLabel;
    Label1: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Shape2: TShape;
    Label9: TLabel;
    Label10: TLabel;
    Shape3: TShape;
    Label11: TLabel;
    Shape4: TShape;
    Label12: TLabel;
    Shape5: TShape;
    Label13: TLabel;
    procedure Label7Click(Sender: TObject);
    procedure Label6Click(Sender: TObject);
    procedure Label8Click(Sender: TObject);
    procedure Label8MouseLeave(Sender: TObject);
    procedure Label8MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormActivate(Sender: TObject);
    procedure Label5Click(Sender: TObject);
    procedure Label10Click(Sender: TObject);
    procedure Label11Click(Sender: TObject);
    procedure Label13Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses ufSetRoom, ufSetTeacher, ufSetClass, uSetTutorArrange, uSetDetail,
  uMainControl, ufSpecial, udm;

{$R *.dfm}

procedure TForm1.Label7Click(Sender: TObject);
begin
  fSetRoom.ShowModal;
end;

procedure TForm1.Label6Click(Sender: TObject);
begin
  dm.tTeacher.Filtered := False;
  fSetTeacher.ShowModal;
  dm.tTeacher.Filtered := True;
end;

procedure TForm1.Label8Click(Sender: TObject);
begin
  fSetClass.ShowModal;
end;

procedure TForm1.Label8MouseLeave(Sender: TObject);
begin
  TLabel(Sender).Font.Color := clSilver;
end;

procedure TForm1.Label8MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  TLabel(Sender).Font.Color := clYellow;
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
  Align := alClient;
  vSchYear := 2016;
  dm.tClass.Filter   := 'SchYear = '+IntToStr(vSchYear);
  dm.tClass.Filtered := True;
  dm.tClass.Open;
  dm.qRoom.Open;
  dm.tTeacher.Filter   := 'LastYear >= '+IntToStr(vSchYear);
  dm.tTeacher.Filtered := True;
  dm.tTeacher.Open;
  dm.tTutorArrange.Filter   := 'SchYear = '+IntToStr(vSchYear);
  dm.tTutorArrange.Filtered := True;
  dm.tTutorArrange.Open;
  dm.tDetail.Filter   := 'SchYear = '+IntToStr(vSchYear);
  dm.tDetail.Filtered := True;
  dm.tDetail.Open;

end;

procedure TForm1.Label5Click(Sender: TObject);
begin
  SetTutorArrange.ShowModal;
end;

procedure TForm1.Label10Click(Sender: TObject);
begin
  MainControl.CheckExistRelated;
  MainControl.InitDB;
  dm.tTeacher.Filtered := True;
  Application.CreateForm(TSetDetail, SetDetail);
  SetDetail.ShowModal;
  SetDetail.Free;
end;

procedure TForm1.Label11Click(Sender: TObject);
begin
  close;
end;

procedure TForm1.Label13Click(Sender: TObject);
begin
  fSpecial.ShowModal;
end;

end.
